import sys
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent
OS = sys.platform

DEBUT = True
SECRET_KEY = 'NKPDVWOEFNPIJPjhpif8hn90v0dnvh0w97jv8y0230ndwuv0w@!*00w9'

# writemall
PASSWD = '5f7b0e45ba6f8d51..'
HOST = '47.106.84.29'
DB_NAME = ['writemall', 'elibrary']
SQLALCHEMY_DATABASE_URI = f'mysql://root:{PASSWD}@{HOST}:3309/{DB_NAME[0]}'
SQLALCHEMY_BINDS = {
    'writemall': f'mysql://root:{PASSWD}@{HOST}:3309/{DB_NAME[0]}',
    'elibrary': f'mysql://root:{PASSWD}@{HOST}:3309/{DB_NAME[1]}',
}

SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_ECHO = True

BASE_FOLDER = 'E:/workspace/file/'

if OS.__contains__('linux') or OS.__contains__('Linux'):
    BASE_FOLDER = '/mydata/file/'

LOG_PATH = './logs/log.log'

LINE_NUMBER = {}


class RedisConfig:
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = '6379'
    REDIS_PASSWD = ''


MODEL_DICT = {}
DEVICE = 'gpu'
